#include<iostream>
using namespace std;
int a[10],b[10],i;
int main(void)
{
  int n,k=0,ok=0;
  cout<<"Introduceti nr de elemente ale vectorului: ";
  cin>>n;
  for(i=0;i<n;i++)
   { cout<<"a["<<i<<"]= ";
     cin>>a[i];
    }

  for(i=0;i<n;i++)
     if(a[i]>=0)
      { b[k]=a[i];
        k++;
        ok=1;
       }   
if(ok==0)
  cout<<"vectorul are toti termenii negativi ";
else
  { cout<<"vectorul nou format este: ";
    for(i=0;i<k;i++)
      cout<<b[i]<<" ";
   }
}

